package com.example.config;

import com.example.interceptor.ProjectInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 这种方式是javaconfig，那么后面springboot工程中，我们会采用这种方式配置拦截器
 */

//@Configuration
public class SpringMvcSupport extends WebMvcConfigurationSupport {


//    @Override
//    protected void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(projectInterceptor()).addPathPatterns("/**"); // 3.注入拦截器对象并设置当URL含有/**时执行拦截
//    }
//
//    @Bean
//    public ProjectInterceptor projectInterceptor(){
//        return new ProjectInterceptor();
//    }


}
